package org.wukongcrm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.wukongcrm.domain.entity.Menu;
import org.wukongcrm.domain.model.MenuVo;

import java.util.List;

@Mapper
public interface MenuMapper extends BaseMapper<Menu> {
    List<Menu> findPermissionsByUserId (Integer userId);

    List<MenuVo> queryAll (@Param("id") Integer id, @Param("isFunction") Boolean isFunction);

    List<MenuVo> findMenuByUserId (@Param("userId") Integer userId, @Param("id") Integer parentId);

    List<Menu> findPermissionsByRoleId (@Param("roleId") Integer roleId);

    List<Menu> findFirstMenu (@Param("id") Integer id);
}